package org.github.core.base;

import lombok.val;
import org.github.core.exception.ValidException;
import static com.github.houbb.validator.core.util.ValidHelper.failFast;
import static org.github.core.util.TrimUtil.trimObj;

public interface Bo extends Json {
  default void valid() {
    trim();
    val result = failFast(this);
    if (!result.pass()) throw new ValidException(result);
  }

  default void trim() {
    trimObj(this);
  }
}
